<template>
  <div class="container">
    <div class="container__header">
      <Header :currentId="1" />
    </div>
    <div class="container-body">
      <div class="day" v-for="(itemDay,index) in dataList" :key="index">
        <div class="day-item">
          <div class="day-title">
            <img src="@/assets/biaoti@2x.png" />
            <div class="text">
              <span class="font18">识别人数 : {{itemDay.count}}人</span>
              <span class="font18">时间 : {{itemDay.time }}</span>
            </div>
          </div>
          <div class="servo-list">
            <div v-for="(userVoListItem,index) in itemDay.userVoList" :key="index">
              <div class="item">
                <el-image
                    style="width: 200px; height: 100px"
                    :src="userVoListItem.path"
                    :preview-src-list="[userVoListItem.path]"
                    fit="fit">
                </el-image>
                <span>注册时间: {{userVoListItem.pathTime }}</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import {
   getUserSum
} from "@/api/home";
import Header from "@/components/Header.vue";

export default {
  name: "mostOnce",
  components: {
    Header,
  },
  computed: { ...mapGetters(["userId"]) },

  data() {
    return {
      dataList:[],
    };
  },

  mounted() {
    this.getUserSum();
  },

  methods: {
    //折线图
    async getUserSum() {
      let res = await getUserSum({
        startTime:this.$route.params.startTime,
      });
      if (res.code === 200) {
        if (res.data){
          this.dataList = res.data;
        }
      }
    },
  }
};
</script>


<style lang="scss" scoped>
.container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  .container-body{
    .day{
      padding: 15px;
      margin: 20px 20px 0 20px;
      background-color: #303136;
      border-radius: 10px;
      .day-item{
        .day-title{
          display: flex;
          gap: 5px;
          img{
            width: 24px;
            height: 24px;
          }
          .text{
            display: flex;
            span{
              text-align: left;
              width: 150px;
              color: #ffffff;
              font-size: 18px;
            }
          }
        }
        .servo-list{
          margin-top: 10px;
          display: flex;
          flex-wrap: wrap;
          gap: 20px;
          .item{
            padding: 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            border: 1px #45777A solid;
            border-radius: 5px;
            gap: 5px;
            background: #363940CC;

            span{
              color: #ffffff;
              font-size: 16px;
            }
          }
        }
      }
    }
  }

}
</style>
